package com.example.demo.controller;

import com.example.demo.log.MyLog;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by zhanpengguo on 2019/7/3.
 * 免登录
 */
@Controller
@RequestMapping("/api")
public class ApiController {

    @RequestMapping("/test")
    @ResponseBody
    public String test(){
        return "无需登录，获取数据";
    }

    /**
     * 免登录进入首页
     * @return
     */
    @RequestMapping("/index")
    @MyLog("进入首页")
    public String index() throws Exception{
        Thread.sleep(3000);
        return "/index";
    }
}
